<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="include/base.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
    <style type="text/css">
    	#nav2{
    		margin: 40px auto;
    	}
    </style>
  </head>
  <body>
    <%@ include file="include/top.jsp"%>
    <ul id="nav2" class="breadcrumb">
	  <li><a href="operatorList"><img src="<%=basePath %>static/img/ope.png"/></a></li>
	</ul>
    <div class="container">
    	<div id="myModal2" class="modal hide fade in" style="dispaly:none;">
			<div class="modal-header">
				<h3>系统信息提示：</h3>
			</div>
			<div class="modal-body">
				确定要删除信息吗？
			</div>
			<div class="modal-footer">
				<input id="removeBtn" type="button" class="btn btn-success" value="确定"/>
				<input type="button" class="btn" data-dismiss="modal" value="取消"/>
			</div>
		</div>
   		<div class="tabbable" style="margin-bottom: 9px;">
	    <ul class="nav nav-tabs">
		    <li class="active"><a href="#1" data-toggle="tab">操作员信息</a></li>
		    <li><a href="#2" data-toggle="tab">添加操作员</a></li>
	    </ul>
	    <div class="tab-content">
	    	<div class="tab-pane active" id="1">
	    		<table class="table">
					<thead>
						<tr>
							<th>操作员名称</th>
							<th>密码</th>
							<th>角色</th>
							<th>操作</th>
					  	</tr>
				 	</thead>
				 	<tbody>
				 		<c:forEach items="${operatorList}" var="operator">
					 		<tr>
								<td>${operator.username }</td>
								<td>${operator.password }</td>
								<td>${operator.role }</td>
								<td>
									<a class="btn btn-danger" rel="${operator.id}" href="#myModal2" data-toggle="modal">删除</a>
								</td>
							</tr>
						</c:forEach>
				 	</tbody>
				</table>
	    	</div>
		    <div class="tab-pane" id="2">
	    		<form class="form-horizontal" action = "addOperator" method="post">
					 <div class="control-group">
						<label class="control-label" for="input01">操作员名称：</label>
						<div class="controls">
							<input type="text" class="span4" name="username">
						</div>
					</div>
				    <div class="control-group">
						<label class="control-label" for="input01">输入密码：</label>
						<div class="controls">
							<input type="text" class="span4" name="password">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="input01">确认密码：</label>
						<div class="controls">
							<input type="text" class="span4">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="input01">设置权限：</label>
						<div class="controls">
							<select id="multiSelect" name="role">
								<option></option>
								<option>操作员</option>
								<option>管理员</option>
							</select>
						</div>
					</div>
					<div class="form-actions">
						<button class="btn btn-primary" type="submit"><i class="icon-ok-sign icon-white"></i>保存</button>
						<a class="btn" href="sales.jspx?task=list"><i class="icon-remove-sign"></i>取消</a>
					</div>
			    </form>
	    	</div>
	    </div>
	   </div> 
	</div>
	<script type="text/javascript">
		var removeId ="";
		$(document).ready(function(){
			$("td .btn").click(function(){
				removeId = $(this).attr("rel");
			});
			$("#removeBtn").click(function(){
	    		window.location.href="delOperator" + removeId;
	    	});
		});
	</script>
  </body>
</html>
